package com.example.lotterysystem.service.enmus;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor //全参构造
@Getter
public enum ActivityPrizeTiersEnum {
    FIRST_PRIZE(1,"一等奖"),

    SECOND_PRIZE(2,"二等奖"),

    THIRD_PRIZE(3,"三等奖");

    private final Integer code;

    private final String message;

    //根据传入的字符串名称来查找并返回对应的 ActivityStatusEnum 枚举实例
    public static ActivityPrizeTiersEnum forName(String name) {
        for (ActivityPrizeTiersEnum activityPrizeTiersEnum:ActivityPrizeTiersEnum.values()) {
            if(activityPrizeTiersEnum.name().equalsIgnoreCase(name)) {
                return activityPrizeTiersEnum;
            }
        }
        return null;
    }
}
